# import rest_framework_jwt
#
#
# def jwt_response_payload_handler(token, user=None, request=None):
#     return {
#         'token': token,
#         'userInfo': {
#             'user_id': user.id,
#             'user_name': user.username,
#             'create_time': user.create_time,
#             'update_time': user.update_time,
#             'username': user.username,
#             'name': user.name,
#             'phone': user.phone,
#             'desc': user.desc,
#             'last_login': user.last_login,
#             'is_system': user.is_system,
#             'is_active': user.is_active,
#             'sex': user.sex,
#             'email': user.email,
#             'roles': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
#         },
#         'code': 200
#     }
#
#
# def jwt_response_payload_error_handler(serializer, request = None):
#     return {
#         "msg": "用户名或者密码错误",
#         "code": 400,
#         "detail": serializer.errors
#   }
